import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export const constantRouterMap = [
  {
    path:'/',
    redirect:'login',

  },{
    path:'/login',
    name:'login',
    component:()=>import(/*webpackChunkName:"login"*/'@/views/basePage/login.vue')
  },
]

const createRouter = () => new Router({
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRouterMap
})
const router = createRouter()

export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher
}

export default router
